<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AES Decryption for Task Points (WASM Demo)</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .container {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        h1 {
            color: #333;
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin: 10px 0 5px;
            font-weight: bold;
        }
        input, textarea {
            width: 100%;
            padding: 8px;
            margin-bottom: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        button {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background-color: #45a049;
        }
        .output {
            margin-top: 20px;
            border: 1px solid #ddd;
            padding: 15px;
            border-radius: 4px;
            background-color: #f9f9f9;
            white-space: pre-wrap;
        }
        .loading {
            color: #666;
            font-style: italic;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>AES Decryption for Task Points (WASM Demo)</h1>
        <p>This demo shows how to decrypt reward data using AES-256-CBC in WebAssembly</p>
        
        <div class="form">
            <label for="email">Email:</label>
            <input type="text" id="email" value="mimi@qq.com" />
            
            <label for="timestamp">Timestamp:</label>
            <input type="text" id="timestamp" value="1718101234" />
            
            <label for="signature">Encrypted Signature (Base64):</label>
            <textarea id="signature" rows="4" placeholder="Paste encrypted signature here"></textarea>
            
            <button id="decrypt-btn">Decrypt</button>
            
            <div class="output-container">
                <label>Decrypted Output (reward JSON):</label>
                <div class="output" id="output">
                    <span class="loading">Waiting for decryption...</span>
                </div>
            </div>
        </div>
    </div>
    
    <script type="module" src="main.js"></script>
</body>
</html>